
class Solution {
public:
    int sumOddLengthSubarrays(vector<int>& arr) {
        int n=arr.size();

        int sum=0;
        for(int k=1;k<=n;k+2){
            for(int y=0;y+k<n;y++){
                for(int x=0;x<k;x++){
                    sum=sum+arr[y+x];
                }
            }

        }
return sum;
    }
};